<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			function Fn(x, y) {
			    let sum = 10;
			    this.total = x + y;             
			    this.say = function () {
			        console.log(`我计算的和是:${this.total}`);
			    };
			    // return {name:'哈哈'};
			}
			let res = Fn(10, 20); //普通函数执行   
			let f1 = new Fn(10, 20); //构造函数执行   优先级20
			
			let res2=Fn;//Fn没有小括号，不是函数执行，是函数本身
			console.log(res2);
			
			let f2=new Fn;//构造函数执行，只不过没传参数  优先级19
			console.log(f2);
			
			console.log(f1.sum);//undefined 
			console.log(f1.total); //30
			console.log(f1.say===f2.say);//false
		</script>
	</body>
</html>
